package com.wms.controller;

import com.wms.entity.WEntryStore;
import com.wms.entity.WOutStore;
import com.wms.mytool.Result;
import com.wms.service.WOutStoreService;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 出库单表(WOutStore)表控制层
 *
 * @author Li Xiaoyu
 * @since 2023-10-22 21:32:57
 */
@RestController
@RequestMapping("/outStore")
public class WOutStoreController {
    /**
     * 服务对象
     */
    @Resource
    private WOutStoreService wOutStoreService;

    /**
     * 查询所有出库信息
     * @return 实例对象
     */
    @GetMapping("/selectAll")
    public Result selectAll(){
        return this.wOutStoreService.selectAll();
    }

    /**
     * 添加出库信息
     * @param wOutStore 出库信息
     * @return 实例对象
     */
    @PostMapping("/addOutStore")
    public Result addOutStore(@RequestBody List<WOutStore> wOutStore){
        return this.wOutStoreService.addOutStore(wOutStore);
    }

    /**
     * 删除出库信息
     * @param id 出库id
     * @return 实例对象
     */
    @DeleteMapping("{id}")
    public Result deleteOutStore(@PathVariable("id") Integer id){
        return this.wOutStoreService.deleteOutStore(id);
    }

}

